package com.example.makerspace.handler;

import com.example.makerspace.service.BmsLogService;
import org.springframework.web.bind.annotation.RestControllerAdvice;
import javax.annotation.Resource;;
import javax.servlet.http.HttpServletResponse;

/**
 * 异常处理类
 *
 */
@RestControllerAdvice
public class ExceptionHandler {

    @Resource
    private BmsLogService bmsLogService;
    @org.springframework.web.bind.annotation.ExceptionHandler(value = Exception.class)
    ExceptionMessage HandlerException(Exception e, HttpServletResponse response) {
        return new ExceptionMessage(response.getStatus(), e.getMessage());
    }

}

